<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script>
    // let obj = new Object();
    // //添加属性
    // obj.name = "张三";
    // obj.age = 20;
    //
    // alert(obj.name+"   "+obj['age']);
    // //删除obj对象的age属性
    // delete obj.age;
    // alert(obj.name+"   "+obj['age']);
    // //定义obj对象的方法
    // obj.speak = function (){
    //   alert("hello");
    // }
    // //调用对象方法
    // obj.speak();
    //
    // //遍历对象中所有的属性名和属性值
    // for(let fieldName in obj){
    //   console.log("属性名："+fieldName+"   "+obj[fieldName]);
    // }

    // let man = {"code":"001",name:"张三",age:30};
    // alert(man.name+"   "+man["code"]+"  "+man.age);

    let array = [
      {code:"001",name:'张三',age:20},
      {code:"005",name:'李四',age:43},
      {code:"003",name:'刘勇',age:36},
      {code:"002",name:'何军',age:26}
    ];

    //遍历json数组
    for(let i=0;i<array.length;i++){
      console.log(array[i].code+"   "+array[i].name+"   "+array[i].age);
    }

  </script>
</head>
<body>

  <select multiple style="width: 100px;height: 100px">
      <option>d</option><!--selected-->
    <option>d</option>
    <option>d</option>
    <option>d</option>
  </select>
</body>
</html>
